<include file="public/layout" />
<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>策划师分组管理 - 编辑会员分组</h3>
                <h5>网站系统会员等级管理</h5>
            </div>
        </div>
    </div>
    <form class="layui-form" id="handleposition" method="post">
        <input type="hidden" name="act" value="{$act}">
        <input type="hidden" name="cat_id" value="{$info.cat_id}">

        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="level_name"><em>*</em>分组名称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="cat_name" value="{$info.cat_name}" id="level_name" class="input-txt">
                    <span class="err" id="err_level_name"></span>
                    <p class="notic">设置策划师分组名称</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    分组描述
                </dt>
                <dd class="opt">
                    <textarea  name="describe" class="tarea" rows="6">{$info.describe}</textarea>
                    <span class="err" id="err_describe"></span>
                    <p class="notic">分组描述信息</p>
                </dd>
            </dl>


            <dl class="layui-form-item row">
                <dt class="layui-form-label tit">选择人员</dt>
                <div class="layui-input-block opt">
                    <volist name="userList" id="vo">
                        <input type="checkbox" name="user_list[]" title="{$vo.nickname}" value="{$vo.user_id}" <notempty name="info.user_list"><if in_array($vo.user_id,$info.user_list)>checked</if>></notempty> >
                    </volist>
                </div>
            </dl>



            <div class="bot"><a href="JavaScript:void(0);" onclick="verifyForm()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>

<script src="__PUBLIC__/layui/layui.all.js" charset="utf-8"></script>
<script type="text/javascript">
    function verifyForm(){
        $('span.err').show();
        $.ajax({
            type: "POST",
            url: "{:U('Admin/User/catHandle')}",
            data: $('#handleposition').serialize(),
            dataType: "json",
            error: function () {
                layer.alert("服务器繁忙, 请联系管理员!");
            },
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg, {icon: 1});
                    location.href = "{:U('Admin/User/catList')}";
                } else {
                    layer.msg(data.msg, {icon: 2});
                    $.each(data.result, function (index, item) {
                        $('#err_' + index).text(item).show();
                    });
                }
            }
        });
    }
</script>
</body>
</html>